#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    _canvas.setParent(this);
    AxisSprite* m = _canvas.createMapObject(3, 3);
    AxisSprite* m2 = _canvas.createMapObject(2, 2);
    AxisSprite* m3 = _canvas.createMapObject(1, 3);
    AxisSprite* m4 = _canvas.createMapObject(5, 8);
    _canvas.addMapObject(m, 1, 1);
    _canvas.addMapObject(m2, 5, 5);
    _canvas.addMapObject(m3, 1, 5);
    _canvas.addMapObject(m4, 46, 20);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::resizeEvent(QResizeEvent *event)
{
    _canvas.setGeometry(0, 0, width(), height());
}
